home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-01
/
tcoop10a.zip
/
DOC.ZIP
/
SOUND.DOC
< prev
next >
Wrap
Text File
|
1991-11-20
|
3KB
|
87 lines
SOUND.DOC 11/15/91 Copyright (c) 1991 by James S. Clark
==========================================================================
SOUND
Sound Class
--------------------------------------------------------------------------
Class Name Sound
Superclass <none>
Category Sound
Other classes referenced <none>
Other catagories referenced <none>
Used by Play, Effect
Inherited by Play
Declaration Sound *soundsys
Instance Variables
<none>
Instance Methods
Sound();
~Sound();
void close ();
int flush ();
void init ();
int inplay ();
void noise (int , int );
void noiseoff();
int submit (int , int );
--------------------------------------------------------------------------
GENERAL DESCRIPTION
The Sound Class provides a means for creating background sound effects
and music. The Sound Class hooks into the system clock interrupt and
does not interfere with foreground program operation. Tones are submitted
to the sound buffer directly, or by using the Play or Effect Class to
create the tones.
NOTE: Sound Class will alter the system clock. Only ONE instance of the
Sound Class should be in memory at any given time.
--------------------------------------------------------------------------
VARIABLES
<none>
--------------------------------------------------------------------------
METHODS
Sound();
Creates and initializes a new instance of the Sound Class;
~Sound();
Automatically Closes and destroys an instance of the Sound Class.
void close ();
Closes down the sound system. Called by ~Sound().
int flush ();
Flushes out any remaining tones in the sound buffer.
void init ();
Initializes the Sound Class. Called by Sound().
int inplay ();
Returns with 1 if tones remain in the buffer. Returns with 0 if
the buffer is empty.
void noise (int freq, int range);
Turns-on the background noise. Freq controls the center frequency
of the noise. Range controls the range of frequency variation.
The noise will be generated when no other tones are playing.
void noiseoff();
Turns-off the background noise.
int submit (int freq , int dur);
Submits a new tone to the sound buffer. The freq parameter
controls the frequency of the tone. The dur is the duration of
the sound expressed in milliseconds (1/1000th of a second).
TECH NOTE: The default for the sound routine is approx. 128
interrupts per second. Tones with a duration between 1 and 8
will be too short to be accurately reproduced at the default
rate. Change the interrupt rate if you need the added precision.
--------------------------------------------------------------------------
SOUND.DOC Copyright (c) 1991 by James S. Clark
==========================================================================